<template>
	<view class="mainpadding" style="padding-bottom: 150rpx;">
		<view class="mainpadding2 ffffff radius" v-if="list.data.length">
			<view class="" style="padding-top: 30rpx;" v-for="(item,index) in  list.data" :key="index">
				<view class="flexbetween" >
					<view class="titletext bold hei_text">{{item.name}}</view>
					<view class="titletext bold huang_text">${{item.dk_money}}</view>
				</view>
				<view class="flexbetween margin_top">
					<view class="xiaohui" :class="index==3?'':'pdl'">消費時間：{{item.updatetiem_text}}</view>
					<view class="xiaohong" v-if="item.zongdian_paystatus==1">未支付</view>
					<view class="xiaolv" v-if="item.zongdian_paystatus==2">已支付</view>
				</view>
			</view>
		</view>
		<view class="posibottom mainpadding" style="bottom: 0;">
			<view class="flexbetween">
				<view class="leftAllprice flexleft mainpadding ffffff">
					<view class="hei_text main_size">合計：</view>
					<view class="huang_text main_size">${{list.total_price}}</view>
				</view>
				<view class="rightsubmit flexcenter mainpadding" style="flex: 2;">
					<view class="hei_text main_size" @click="payshop">立即支付</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				listid:"",
				list:[]
			}
		},
		onLoad(options) {
			this.listid = options.id
			this.init()
		},
		methods: {
			init(){
				httpRequest.request('/api/shop/fendianUserRall', 'GET', {
					id: this.listid
				}).then(res => {
					this.list = res.data
				})
			},
			payshop(){
				httpRequest.request('/api/shop/fendianPay', 'GET', {
					id: this.listid,
					shop_id:uni.getStorageSync("shop_id")
				}).then(res => {
					httpRequest.toast(res.msg)
					if(res.code==1){
						setTimeout(()=>{
							uni.navigateBack(1)
						},1000)
					}
				})
			},
		}
	}
</script>

<style>

</style>
